<?php

class  Zend_View_Helper_EchoIfLoggedin extends Zend_View_Helper_Abstract implements Zend_View_Helper_Interface {

	/**
	 * konditionelles echo
	 *
	 */
	public $view;

	/**
	 * View Helper zur Verfügung stellen
	 * @param Zend_View_Interface $view
	 */
	public function setView(Zend_View_Interface $view) {
		$this->view = $view;
	}

	/**
	 *
	 */
	public function  echoIfLoggedin($user, $txt) {
		$auth = Zend_Auth::getInstance();
		if ($auth->hasIdentity()) {
			$userId = $auth->getIdentity();
			$userId = $userId[1];
			// echo("$user / $userId");  pog-test
			if ($user == $userId) {
				echo ($txt);
			}
		}

	}
}


